cmake_minimum_required(VERSION 3.27)
project(desktop)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_PREFIX_PATH "D:/Qt/6.7.3/msvc2022_64/bin")
# 使用 vcpkg 的工具链文件
include(D:/vcpkg/scripts/buildsystems/vcpkg.cmake)

find_package(Qt6 COMPONENTS
        Core
        Gui
        Widgets
        REQUIRED)
find_package(OpenCV CONFIG REQUIRED)
find_package(boost_asio REQUIRED CONFIG)
find_package(boost_lockfree REQUIRED CONFIG)

# 设置 VLD 路径
set(VLD_INCLUDE_DIR "C:/Program Files (x86)/Visual Leak Detector/include")
set(VLD_LIB_DIR "C:/Program Files (x86)/Visual Leak Detector/lib/Win64")

# 添加 VLD 头文件路径
include_directories(${VLD_INCLUDE_DIR})

# 添加 VLD 库文件路径
link_directories(${VLD_LIB_DIR})

file(GLOB SOURCES *.cpp)
file(GLOB HEADERS *.h)

add_executable(desktop ${HEADERS} ${SOURCES})

target_link_libraries(desktop
        Qt::Core
        Qt6::Gui
        Qt6::Widgets
        vld
        ${OpenCV_LIBS}
        Boost::asio
        Boost::lockfree
)